﻿using ESMAM.BLL.SYS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ESMAM.WebApp.Controllers
{
    public class WordTypeController : Controller
    {
        // GET: WordType
        public ActionResult Index()
        {
            return View();
        }


        [HttpPost]
        public ActionResult WordTypeSearch(int pageCurrent, int pageSize, string orders)
        {
            var ret = WordTypeBLL.GetPager(Request.Form);
            if (ret.Code == -1)
            {
                return this.JsonBJUI(300, ret.Msg);
            }
            Pager pager = ret.Value;
            return this.JsonNet(pager);
        }


        [HttpPost]
        public ActionResult WordTypeUpsert()
        {
            var ret = WordTypeBLL.Upsert(Request.Form);
            if (ret.Code == -1)
            {
                return this.JsonBJUI(300, ret.Msg);
            }
            return this.JsonBJUI(200, ret.Msg);
        }

        [HttpPost]
        public ActionResult DelWordType(string id)
        {
            return this.JsonNet(WordTypeBLL.Delete(id));
        }
    }
}